package polymorphism;

public class Test {
    public static void main(String[] args) {
        Person p1=new Person(30,"老王");
        Dog d=new Dog(2,"黑");
        p1.keepPet(d,"骨头");

        Person p2=new Person(30,"老李");
        Cat c=new Cat(1,"黑");
        p2.keepPet(c,"鱼");

        Person p=new Person(23,"老王");
        p.keepPet(d,"骨头");
        p.keepPet(c,"鱼");
    }
}
